﻿@model IEnumerable<Alabama.User>
           
           <script type="text/javascript">
               $(document).ready(function () {
                var mess = "@(@Html.Raw(Request.QueryString["message"]))";
                   if (mess!="") {
                        alert(mess);
                        
                   }
               });               
           </script>

<div class="row-fluid">
    <div class="span12">
        <div class="box">
            <div class="box-title">
                <h3>
                    <i class="icon-table"></i>@ViewBag.GroupName</h3>
            </div>
            <div class="box-content">
                <p style="margin-left: 7px;">
                    @Html.ActionLink(" Thêm người dùng", "NewOrEdit", "Account", null, new { @class = "btn btn-primary" })
                    <a href="/Account/NewOrEdit" class="btn btn-primary EditItem">Sửa</a>
                    <a href="/Account/ResetPassWord" class="btn btn-primary EditItem">Reset mật khẩu</a>
                    <a href="/Account/LockByListID" class="btn btn-primary LockUser">Khóa</a> 
                    <a href="/Account/DeleteByListID" class="btn btn-danger DeleteItem confirmDelete">Xóa</a>
                </p>
                <table class="table">
                    <thead>
                        <tr class="table-flag-blue">
                            <th style="width: 18px">
                                <input type="checkbox" class="checkAll" />
                            </th>
                            <th>
                                User name
                            </th>
                            <th>
                                Họ tên
                            </th>
                            <th>
                                Trạng thái
                            </th>
                            <th>
                                Email
                            </th>
                        </tr>
                    </thead>
                    <tbody>
                        @foreach (var item in Model)
                        {
                            <tr>
                                <td>
                                    <input type="checkbox" class="checkitem" value="@item.ID" />
                                </td>
                                <td>
                                    @Html.ActionLink(string.IsNullOrEmpty(item.UserName) ? " " : item.UserName, "NewOrEdit", new { id = item.ID })
                                </td>
                                <td>
                                    @item.Name
                                </td>                                
                                <td>
                                    @(item.Locked?"Bị khóa":"Đang hoạt động")
                                </td>
                                <td>
                                    @item.Email
                                </td>
                            </tr>
                        }
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
